package com.designMode.principle;

/**
 * 单一职责.
 */
public class SingleResponsibility_01 {
	public static void main(String[] args) {
		new Vehicle().run("person");
		new Vehicle().runRoad("car");

	}
}


/**
 * 虽然下面在类层面不是单一职责,但在方法上是单一职责
 */
class Vehicle{
	public void run(String s){
		System.out.println("run");
	}

	public void runRoad(String s){
		System.out.println("run on the road...");
	}
}
